package customers.restclient;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import customers.model.CustomerBasic;
import customers.model.CustomerBasicResp;
import customers.service.CustomerBasicService;

@Controller
@RequestMapping(value="/userStatusInfoRest",method={RequestMethod.POST})

public class UserStatusInfoRest {
	
	private final static Logger logger = LoggerFactory.getLogger(UserStatusInfoRest.class);

	@Autowired
	private CustomerBasicService customerBasicMapper;
	
	@RequestMapping("/unfreeze")  
    @ResponseBody
	public String unfreeze(@RequestBody CustomerBasic parm){
		
		CustomerBasic customerBasic = new CustomerBasic();
		customerBasic.setMemberId(parm.getMemberId());
		customerBasic.setUnfrozen(parm.getUnfrozen());
		CustomerBasicResp<CustomerBasic> res = customerBasicMapper.updateUnfrozenByMemberID(customerBasic);
		if(res.getResultMsg().equals("修改成功")){
			return "ok";
		}else{
			return "no";
		}
		
	}
}
